package com.css.apps.base.user.action;

import com.css.apps.base.user.po.UserInfoPageVo;
import com.css.apps.base.user.service.UserService;
import com.css.util.Messages;
import com.css.util.StringHelper;
import com.opensymphony.xwork.Action;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@SuppressWarnings("serial")
public class ViewUser extends UserAction {
	private static Log log = LogFactory.getLog(ViewUser.class);
    private String userId;    //userId
    private UserInfoPageVo userInfoPageVo;

	@SuppressWarnings("unchecked")
	public String userGo() {
        try {
            if(StringHelper.isNotEmpty(userId)){
                UserService userService = new UserService();
                userInfoPageVo = userService.createAllUserInfoPageVo(userId);
            }
            return Action.SUCCESS;
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
            setMessage(Messages.getString("systemMsg.exception"));
            return Action.ERROR;
        }
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public UserInfoPageVo getUserInfoPageVo() {
        return userInfoPageVo;
    }

    public void setUserInfoPageVo(UserInfoPageVo userInfoPageVo) {
        this.userInfoPageVo = userInfoPageVo;
    }
}
